﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace RFMobile
{
    public partial class mainScreen : Form
    {
        public mainScreen()
        {
            InitializeComponent();
            this.ShowDialog();
        }
       
        private void menuItem2_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            if (radioButton1.Checked)
            {
                Cursor.Current = Cursors.Default;
                machineScreen machine = new machineScreen();
                radioButton1.Checked = false;
                statusBar1.Text = "";
                machine = null;
            }

            if (radioButton2.Checked)
            {
                Cursor.Current = Cursors.Default;
                searchScreen allmaintenance = new searchScreen();
                radioButton2.Checked = false;
                statusBar1.Text = "";
                allmaintenance = null;
            }

            if (radioButton4.Checked)
            {
                Cursor.Current = Cursors.Default;
                /*
                syncScreen sync = new syncScreen();
                radioButton4.Checked = false;
                statusBar1.Text = "";
                sync = null;
                */
            }
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            statusBar1.Text = "Ver detalle máquina y agregar mantención";
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            statusBar1.Text = "Ver todas las mantenciones registradas";
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            statusBar1.Text = "Agregar maquinas, encargados, etc.";
        }

        private void mainScreen_KeyDown(object sender, KeyEventArgs e)
        {
            if ((e.KeyCode == System.Windows.Forms.Keys.Up))
            {
                // Up
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Down))
            {
                // Down
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Left))
            {
                // Left
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Right))
            {
                // Right
            }
            if ((e.KeyCode == System.Windows.Forms.Keys.Enter))
            {
                // Enter
            }

            if (e.KeyCode.ToString().ToUpper() == "O")
            {
                radioButton1.Checked = true;
            }

            if (e.KeyCode.ToString().ToUpper() == "B")
            {
                radioButton2.Checked = true;
            }
            
            if (e.KeyCode.ToString().ToUpper() == "S")
            {
                radioButton4.Checked = true;
            }
        }

        private void menuItem6_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void menuItem5_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            statusBar1.Text = "Sincronizar bases de datos, móvil y servidor";
        }

        private void panel1_GotFocus(object sender, EventArgs e)
        {

        }
    }
}